package com.example.demo.entity.primary;

import javax.persistence.*;

/**
 * Created by dongjunpeng on 2017/10/12.
 */
@Entity
@Table(name = "rtsp_relay")
public class RtspRelayEntity {
    private int rtspRelayId;
    private String rtspRelayName;
    private String rtspRelayIpAddress;
    private String rtspRelayControlPort;
    private Integer craneId;

    @Id
    @Column(name = "rtsp_relay_id")
    public int getRtspRelayId() {
        return rtspRelayId;
    }

    public void setRtspRelayId(int rtspRelayId) {
        this.rtspRelayId = rtspRelayId;
    }

    @Basic
    @Column(name = "rtsp_relay_name")
    public String getRtspRelayName() {
        return rtspRelayName;
    }

    public void setRtspRelayName(String rtspRelayName) {
        this.rtspRelayName = rtspRelayName;
    }

    @Basic
    @Column(name = "rtsp_relay_ip_address")
    public String getRtspRelayIpAddress() {
        return rtspRelayIpAddress;
    }

    public void setRtspRelayIpAddress(String rtspRelayIpAddress) {
        this.rtspRelayIpAddress = rtspRelayIpAddress;
    }

    @Basic
    @Column(name = "rtsp_relay_control_port")
    public String getRtspRelayControlPort() {
        return rtspRelayControlPort;
    }

    public void setRtspRelayControlPort(String rtspRelayControlPort) {
        this.rtspRelayControlPort = rtspRelayControlPort;
    }

    @Basic
    @Column(name = "crane_id")
    public Integer getCraneId() {
        return craneId;
    }

    public void setCraneId(Integer craneId) {
        this.craneId = craneId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        RtspRelayEntity that = (RtspRelayEntity) o;

        if (rtspRelayId != that.rtspRelayId) return false;
        if (rtspRelayName != null ? !rtspRelayName.equals(that.rtspRelayName) : that.rtspRelayName != null)
            return false;
        if (rtspRelayIpAddress != null ? !rtspRelayIpAddress.equals(that.rtspRelayIpAddress) : that.rtspRelayIpAddress != null)
            return false;
        if (rtspRelayControlPort != null ? !rtspRelayControlPort.equals(that.rtspRelayControlPort) : that.rtspRelayControlPort != null)
            return false;
        if (craneId != null ? !craneId.equals(that.craneId) : that.craneId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = rtspRelayId;
        result = 31 * result + (rtspRelayName != null ? rtspRelayName.hashCode() : 0);
        result = 31 * result + (rtspRelayIpAddress != null ? rtspRelayIpAddress.hashCode() : 0);
        result = 31 * result + (rtspRelayControlPort != null ? rtspRelayControlPort.hashCode() : 0);
        result = 31 * result + (craneId != null ? craneId.hashCode() : 0);
        return result;
    }
}
